﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Visual_CRUD_Plugins_InstallPlugin : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        verificaUser();
    }
    protected void verificaUser()
    {
        VSDBM.Code.dto.User usuariologado = (VSDBM.Code.dto.User)HttpContext.Current.Session["usuariologado"];
        if (!(usuariologado.acessgroup == 1))
        {
            HttpContext.Current.Session["exception"] = "You are not authorized!";
            Response.Redirect("~/Visual/Errors/error.aspx");
        }
    }
    protected void btnSave_Click(object sender, ImageClickEventArgs e)
    {
        Plugins plugin = new Plugins(0,tbdescription.Text, tbversion.Text, tblocalization.Text, tbprocname.Text, 1);
        PluginsDAO.add(plugin);
        Response.Redirect("ListPlugin.aspx");
    }
}